package com.ldxiwxr.system.service.impl;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ldxiwxr.system.entity.Comment;
import com.ldxiwxr.system.mapper.CommentMapper;
import com.ldxiwxr.system.service.IArticleCommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ArticleCommentServiceImpl implements IArticleCommentService {

    @Resource
    private CommentMapper commentMapper;

    @Override
    public List<Comment> getCommentListByArticleId(String articleId) {
        return commentMapper.selectList(Wrappers.<Comment>lambdaQuery().eq(StringUtils.isNotBlank(articleId),Comment::getArticleId, articleId));
    }
}
